#include "Protocol_UDP.h"

CProtocol_UDP::CProtocol_UDP(void)
{
	name = "UDP";
}

CProtocol_UDP::~CProtocol_UDP(void)
{
}

StackUtils::e_Status CProtocol_UDP::Decode( CPacket& packet )
{
	packet.removeElements(0, name.size() + 2);
	packet.removeElements(packet.getBufferContent().size() - (name.size() + 2), name.size() + 2);
	return StackUtils::E_SUCCESS;
}

StackUtils::e_Status CProtocol_UDP::Encode( CPacket& packet )
{
	packet.addFront("[UDP]");
	packet.addBack("[UDP]");
	return StackUtils::E_SUCCESS;
}
